void start(game, id, [int width=0, int height=0]) {
  html.CanvasElement canvas = html.document.query(id);
  if (canvas == null)
    throw new IllegalArgumentException('canvas not found. ($id)');

  if (width > 0 && height > 0) {
    canvas.style.width  = '${width}px';
    canvas.style.height = '${height}px';
  }

  game.graphics = new Graphics(canvas);
  game.renderer = new Renderer(game.graphics);
  game.audio = new Audio();
  game.input = new Input(canvas);
  game._start();
  _run(game);
}

void _run(Game game) {
  html.window.requestAnimationFrame((_) { _run(game); game._tick(); });
}

class Game extends GameBase {
}